﻿namespace Digitalmes.Domain.Entities.Sys;

/// <summary>
/// 角色信息
/// </summary>
[SugarTable("sys_role")]
public sealed class SysRole : AuditedEntity, ISoftDelete
{
    /// <summary>
    /// 角色名称 
    /// </summary>
    [NotNull]
    public string? Name { get; set; }

    /// <summary>
    /// 角色编号
    /// </summary>
    [NotNull]
    public string? Code { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    public int Order { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }

    /// <summary>
    /// 启用状态（0->停用，1->启用）
    /// </summary>
    public EnabledStatusEnum Status { get; set; }

    public bool IsDeleted { get; set; }

    /// <summary>
    /// 角色拥有的菜单对应关系集合。
    /// </summary>
    [Navigate(NavigateType.OneToMany, nameof(SysRoleMenu.RoleId))]
    public List<SysRoleMenu>? RoleMenus { get; set; }
}
